package Client;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;

public class SearchOfWord {

	public static void main(String[] args) {
		SearchOfWord login = new SearchOfWord();
		login.initUI();

	}

	public void initUI() {

		JFrame frame = new JFrame();

		frame.setTitle("Login");
		frame.setSize(400, 650);
		frame.setDefaultCloseOperation(3);
		frame.setLocationRelativeTo(null);
		frame.setResizable(false);

		FlowLayout fl = new FlowLayout(FlowLayout.CENTER, 10, 10);

		frame.setLayout(fl);

		ImageIcon icon = new ImageIcon("/root/图片/a.jpg");

		JLabel labIcon = new JLabel(icon);

		Dimension dim = new Dimension(400, 300);
		labIcon.setPreferredSize(dim);

		frame.add(labIcon);

		JLabel labName = new JLabel("你想要查找的学号");

		frame.add(labName);

		JTextField textName = new JTextField();
		Dimension dim1 = new Dimension(300, 30);

		textName.setPreferredSize(dim1);

		frame.add(textName);

		JButton button = new JButton();

		Dimension dim2 = new Dimension(100, 30);
		button.setText("词频统计柱状图");

		button.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				String xuehao = textName.getText();

				DrawColumnHistogram aa = new DrawColumnHistogram();
				try {
					aa.shuzu(xuehao);
				} catch (SQLException e) {

					e.printStackTrace();
				}
			}
		});

		button.setSize(dim2);
		frame.add(button);

		frame.setVisible(true);
	}

}